﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Vds2465Control;
using Vds2465Telegrams;

namespace Vds2465Control_Test
{
	[TestClass]
	public class TelegramHelper_Test
	{
		[TestMethod]
		[Owner("Frank Eppink")]
		public void Test01_GetUserDataColl()
		{
			{
				UserDataColl userDataColl;
				Telegram_Returning telegram = new Telegram_Returning(eDirection.ATE_to_RCT, 0x55, eTelegramFunction_Returning.FC_ERROR, true, true);
				bool bRetVal = TelegramHelper.GetUserDataColl(telegram, out userDataColl);
				Assert.IsFalse(bRetVal);
			}

			{
				UserData userDataFF = new UserData_FF_ConnectionNotNeeded();
				UserDataColl userDataColl = new UserDataColl();
				userDataColl.Add(userDataFF);
				Telegram_Calling_SEND_NDAT telegram = new Telegram_Calling_SEND_NDAT(eDirection.ATE_to_RCT, 0x55, true, true, userDataColl);
				UserDataColl userDataCollRetrieved;
				bool bRetVal = TelegramHelper.GetUserDataColl(telegram, out userDataCollRetrieved);
				Assert.IsTrue(bRetVal);
				Assert.IsNotNull(userDataCollRetrieved);
				Assert.AreEqual(userDataColl, userDataCollRetrieved);
			}
		}
	}
}
